package com.foreknow.demo11;


import com.foreknow.demo9.Computer;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;

/**
 * 多态实际中的应用
 */
public class Application {
    public void m1(Reader reader){

    }
    public Component m2(){
        Button button = new Button("登录");
        Checkbox checkbox = new Checkbox();

        return button;
    }

    public void m3(){
        Component[] arr = new Component[2];//定义一个Component类型数组（父类）   多态
        Button b1 = new Button("按钮");
        Button b2 = new Button("按钮");
        arr[0]=b1;//向数组赋值
        arr[1]= b2;
    }

    public static void main(String[] args) throws FileNotFoundException {
        Application app= new Application();
        FileReader fileFilter = new FileReader("");
        app.m1(fileFilter);
    }

}
